<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/DatePicker.js"></script>
    <title>商品添加页面</title>
    <script>
        $(document).ready(function () {
            var time = new Date();
            var day = ("0" + time.getDate()).slice(-2);
            var month = ("0" + (time.getMonth() + 1)).slice(-2);
            var today = time.getFullYear() + "-" + (month) + "-" + (day);
            $('#date_info').val(today);
        })
    </script>
</head>
<body>
<div class="row" style="margin-left: 20px;">
    <form action="${pageContext.request.contextPath }/adminGoods?method=updateGoods1" method="post" enctype="multipart/form-data">
        <div>
            <h3>修改商品</h3>
        </div>
        <hr />
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group form-inline">
                    <label>名称:</label>
                    <input type="text" name="name" value="${goods.name}" class="form-control" />
                </div>
                <div class="form-group form-inline">
                    <label>分类:</label>
                    <select name="typeid" class="form-control">
                        <option value="${goods.typeid}">${goods.typeid}</option>
                        <c:forEach items="${goodsTypeList }" var="type">
                            <option value="${type.id }">${type.id }</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group form-inline">
                    <label>时间:</label>
                    <input type="date" name="pubdate" id="date_info" class="form-control" />
                </div>
                <div class="form-group form-inline">
                    <input type="hidden" name="id" value="${goods.id}" class="form-control" />
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group form-inline">
                    <label>价格:</label>
                    <input type="text" name="price" value="${goods.price}" class="form-control" />
                </div>
                <div class="form-group form-inline">
                    <label>评分:</label>
                    <input type="text" name="star" value="${goods.star}" class="form-control" />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-10">
                <div class="form-group form-inline">
                    <label>商品图片</label>
                    <input type="file" name="picture" />
                </div>
                <div class="form-group ">
                    <label>商品简介</label>
                    <textarea  name="intro" value="${goods.intro}" class="form-control" rows="5"></textarea>
                </div>
                <div class="form-group form-inline">
                    <input type="submit" value="修改" class="btn btn-primary" />
                    <input type="reset" value="重置" class="btn btn-default" />
                </div>
            </div>
        </div>
    </form>

</div>
</body>
</html>
